package local.app.servers;

import com.jcraft.jsch.JSch;
import com.jcraft.jsch.JSchException;
import com.jcraft.jsch.Session;
import local.app.authentiction.AuthenticationROOT;

public class CryptoVsxServer extends Server implements AuthenticationROOT {

    private final String userName = AuthenticationROOT.userName;
    private final String password = AuthenticationROOT.password;
    public CryptoVsxServer(String nameServer, String ipAddress) throws JSchException {

        super(nameServer, ipAddress);
        session = this.setConfigAndReturnSession();
    }

    @Override
    public Session setConfigAndReturnSession() throws JSchException {
        Session session = new JSch().getSession(userName, getIpAddress(), getPort());
        session.setPassword(password);
        session.setConfig("StrictHostKeyChecking", "no");
        session.setConfig("KexAlgorithms", "+diffie-hellman-group1-sha1");
        return session;
    }



}
